<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }

      ul,
      ol,
      li {
        list-style: none;
      }

      .box {
        width: 600px;
        height: 360px;
        border: 10px solid skyblue;
        margin: 30px auto;
        display: flex;
        flex-direction: column;
      }

      .box > ul {
        height: 45px;
        display: flex;
      }

      .box > ul > li {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        color: #fff;
        background-color: rgb(65, 173, 112);
        font-size: 30px;
      }

      .box > ul > li.active {
        background-color: rgb(253, 16, 16);
      }

      .box > ol {
        flex: 1;
        position: relative;
      }

      .box > ol > li {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        background-color: rgb(139, 235, 61);
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 100px;
        color: #fff;

        display: none;
      }

      .box > ol > li.active {
        display: flex;
      }
    </style>
  </head>
  <body>
    <div class="box">
      <ul>
        <li class="active">1</li>
        <li>2</li>
        <li>3</li>
      </ul>
      <ol>
        <li class="active">1</li>
        <li>2</li>
        <li>3</li>
      </ol>
    </div>

    <script src="./jquery/jquery.min.js"></script>
    <script>
      $("ul > li").click(function () {
        $(this)
          .addClass("active")
          .siblings("li")
          .removeClass("active")
          .parent()
          .next()
          .children()
          .removeClass("active")
          .eq($(this).index())
          .addClass("active");
      });
    </script>
  </body>
</html>
